package com.test.demo;

/**
 * ${DESCRIPTION}
 *
 * @author muxiaoyu
 * @create 2017/05/16 9:27
 **/
public class DogProxy {
    private DogInterface dogInterface;

    public DogProxy(DogInterface dogInterface) {
        this.dogInterface = dogInterface;
    }

    public void doSay() {
        long startTime = System.nanoTime();
        dogInterface.Say();
        long endTime = System.nanoTime();
        System.out.println("运行时间：" + (endTime - startTime) + "ns");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        DogProxy dogProxy = new DogProxy(dog);
        dogProxy.doSay();
    }
}
